3.215 \(\int \frac {\cot ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=89 \[ -\frac {b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 f (a-b)}-\frac {(a+b) \log (\tan (e+f x))}{a^2 f}-\frac {\log (\cos (e+f x))}{f (a-b)}-\frac {\cot ^2(e+f x)}{2 a f} \]

[Out]

-1/2*cot(f*x+e)^2/a/f-ln(cos(f*x+e))/(a-b)/f-(a+b)*ln(tan(f*x+e))/a^2/f-1/2*b^2*ln(a+b*tan(f*x+e)^2)/a^2/(a-b)
/f

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 446, 72} \[ -\frac {b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 f (a-b)}-\frac {(a+b) \log (\tan (e+f x))}{a^2 f}-\frac {\log (\cos (e+f x))}{f (a-b)}-\frac {\cot ^2(e+f x)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

-Cot[e + f*x]^2/(2*a*f) - Log[Cos[e + f*x]]/((a - b)*f) - ((a + b)*Log[Tan[e + f*x]])/(a^2*f) - (b^2*Log[a + b
*Tan[e + f*x]^2])/(2*a^2*(a - b)*f)

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\cot ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^3 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^2 (1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {1}{a x^2}+\frac {-a-b}{a^2 x}+\frac {1}{(a-b) (1+x)}-\frac {b^3}{a^2 (a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac {\cot ^2(e+f x)}{2 a f}-\frac {\log (\cos (e+f x))}{(a-b) f}-\frac {(a+b) \log (\tan (e+f x))}{a^2 f}-\frac {b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 (a-b) f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.26, size = 63, normalized size = 0.71 \[ -\frac {\frac {b^2 \log \left (a \cot ^2(e+f x)+b\right )}{a^2 (a-b)}+\frac {2 \log (\sin (e+f x))}{a-b}+\frac {\cot ^2(e+f x)}{a}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

-1/2*(Cot[e + f*x]^2/a + (b^2*Log[b + a*Cot[e + f*x]^2])/(a^2*(a - b)) + (2*Log[Sin[e + f*x]])/(a - b))/f

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 128, normalized size = 1.44 \[ -\frac {b^{2} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + {\left (a^{2} - b^{2}\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + {\left (a^{2} - a b\right )} \tan \left (f x + e\right )^{2} + a^{2} - a b}{2 \, {\left (a^{3} - a^{2} b\right )} f \tan \left (f x + e\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*(b^2*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1))*tan(f*x + e)^2 + (a^2 - b^2)*log(tan(f*x + e)^2/(ta
n(f*x + e)^2 + 1))*tan(f*x + e)^2 + (a^2 - a*b)*tan(f*x + e)^2 + a^2 - a*b)/((a^3 - a^2*b)*f*tan(f*x + e)^2)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-(1-cos(f*x+e
xp(1)))/(1+cos(f*x+exp(1)))*1/16/a+(4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f
*x+exp(1)))*b-a)*1/16/a^2/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))+1/(2*a-2*b)*ln(abs((1-cos(f*x+exp(1)))/(1+co
s(f*x+exp(1)))+1))-b^2/(4*a^3-4*a^2*b)*ln(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/
(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b+a)+(-a-b)*1/4/a^2*ln(abs(1-cos(f*x+exp(1)))/
abs(1+cos(f*x+exp(1)))))

________________________________________________________________________________________

maple [A]  time = 0.78, size = 150, normalized size = 1.69 \[ -\frac {b^{2} \ln \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}{2 f \,a^{2} \left (a -b \right )}+\frac {1}{4 f a \left (-1+\cos \left (f x +e \right )\right )}-\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f a}-\frac {\ln \left (-1+\cos \left (f x +e \right )\right ) b}{2 f \,a^{2}}-\frac {1}{4 f a \left (1+\cos \left (f x +e \right )\right )}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f a}-\frac {\ln \left (1+\cos \left (f x +e \right )\right ) b}{2 f \,a^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x)

[Out]

-1/2/f*b^2/a^2/(a-b)*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)+1/4/f/a/(-1+cos(f*x+e))-1/2/f/a*ln(-1+cos(f*x+e))-1/2
/f/a^2*ln(-1+cos(f*x+e))*b-1/4/f/a/(1+cos(f*x+e))-1/2/f/a*ln(1+cos(f*x+e))-1/2/f/a^2*ln(1+cos(f*x+e))*b

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 68, normalized size = 0.76 \[ -\frac {\frac {b^{2} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{3} - a^{2} b} + \frac {{\left (a + b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{2}} + \frac {1}{a \sin \left (f x + e\right )^{2}}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(b^2*log(-(a - b)*sin(f*x + e)^2 + a)/(a^3 - a^2*b) + (a + b)*log(sin(f*x + e)^2)/a^2 + 1/(a*sin(f*x + e)
^2))/f

________________________________________________________________________________________

mupad [B]  time = 11.60, size = 89, normalized size = 1.00 \[ \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f\,\left (a-b\right )}-\frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{2\,a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a+b\right )}{a^2\,f}-\frac {b^2\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}{2\,a^2\,f\,\left (a-b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^3/(a + b*tan(e + f*x)^2),x)

[Out]

log(tan(e + f*x)^2 + 1)/(2*f*(a - b)) - cot(e + f*x)^2/(2*a*f) - (log(tan(e + f*x))*(a + b))/(a^2*f) - (b^2*lo
g(a + b*tan(e + f*x)^2))/(2*a^2*f*(a - b))

________________________________________________________________________________________

sympy [A]  time = 28.09, size = 743, normalized size = 8.35 \[ \begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge e = 0 \wedge f = 0 \\\frac {- \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {\log {\left (\tan {\left (e + f x \right )} \right )}}{f} + \frac {1}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac {1}{4 f \tan ^{4}{\left (e + f x \right )}}}{b} & \text {for}\: a = 0 \\\frac {2 \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{4}{\left (e + f x \right )}}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} + \frac {2 \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} - \frac {4 \log {\left (\tan {\left (e + f x \right )} \right )} \tan ^{4}{\left (e + f x \right )}}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} - \frac {4 \log {\left (\tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} - \frac {2 \tan ^{2}{\left (e + f x \right )}}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} - \frac {1}{2 a f \tan ^{4}{\left (e + f x \right )} + 2 a f \tan ^{2}{\left (e + f x \right )}} & \text {for}\: a = b \\\frac {\tilde {\infty } x}{a} & \text {for}\: e = - f x \\\frac {x \cot ^{3}{\relax (e )}}{a + b \tan ^{2}{\relax (e )}} & \text {for}\: f = 0 \\\frac {\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {\log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {1}{2 f \tan ^{2}{\left (e + f x \right )}}}{a} & \text {for}\: b = 0 \\\frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} - \frac {2 a^{2} \log {\left (\tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} - \frac {a^{2}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} + \frac {a b}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} - \frac {b^{2} \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} - \frac {b^{2} \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} + \frac {2 b^{2} \log {\left (\tan {\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{3} f \tan ^{2}{\left (e + f x \right )} - 2 a^{2} b f \tan ^{2}{\left (e + f x \right )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**3/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(e, 0) & Eq(f, 0)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + log(tan(e +
f*x))/f + 1/(2*f*tan(e + f*x)**2) - 1/(4*f*tan(e + f*x)**4))/b, Eq(a, 0)), (2*log(tan(e + f*x)**2 + 1)*tan(e +
 f*x)**4/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) + 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a*f*t
an(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 4*log(tan(e + f*x))*tan(e + f*x)**4/(2*a*f*tan(e + f*x)**4 + 2*a*f*t
an(e + f*x)**2) - 4*log(tan(e + f*x))*tan(e + f*x)**2/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 2*tan(
e + f*x)**2/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 1/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2
), Eq(a, b)), (zoo*x/a, Eq(e, -f*x)), (x*cot(e)**3/(a + b*tan(e)**2), Eq(f, 0)), ((log(tan(e + f*x)**2 + 1)/(2
*f) - log(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2))/a, Eq(b, 0)), (a**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)
**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - 2*a**2*log(tan(e + f*x))*tan(e + f*x)**2/(2*a**3
*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - a**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2
) + a*b/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - b**2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x)
)*tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - b**2*log(I*sqrt(a)*sqrt(1/b) + tan
(e + f*x))*tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) + 2*b**2*log(tan(e + f*x))*
tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2), True))

________________________________________________________________________________________